package it.controllocredito.frontend.util;

import it.controllocredito.R;
import it.controllocredito.backend.persistence.bean.RegistroChiamate;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class RegistroChiamateArrayAdapter extends ArrayAdapter<RegistroChiamate> 
{
	private final Context context;
	private final RegistroChiamate[] values;

	public RegistroChiamateArrayAdapter(Context context, RegistroChiamate[] values) 
	{
		super(context, R.layout.rowlayout, values);
		this.context = context;
		this.values = values;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) 
	{
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.rowlayout, parent, false);
		TextView textView = (TextView) rowView.findViewById(R.id.label);
		textView.setText(values[position].getPrefissoTel() + values[position].getNumeroTel());
		return rowView;
	}
	
	 
	

}
